home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 9 / CDACTUAL9.iso / share / Dos / VARIOS / pascal / SWAG9605.DDD / 0142_Lawnmower Simulation Game.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1996-05-31  |  7.5 KB  |  321 lines

  1. {
  2. ======================================
  3.  
  4. The SUPER Advanced LawnMower Simulator
  5. (C) 1994 Scott Tunstall
  6.  
  7.  
  8. Original AMIGA Idea by Team 7.5
  9.  
  10. --------------------------------------
  11.  
  12. Just for a laugh... go mow the lawn! Includes probably the EASIEST
  13. control method ever. And what's more the 2 player sequel has been
  14. posted as well!!! Take a LOOK at the QUALITY! :)
  15.  
  16.  
  17. Up till June 15th 1996 you can contact me at: CG93SAT@IBMRISC.DCT.AC.UK
  18. No queries about lawnmowers please.
  19.  
  20.  
  21. Command line params: The path to where your CGA.BGI is stored
  22. will do nicely. If no params are passed C:\tp7\BGI is used as default.
  23. Obviously your BGI may not be there!!!!
  24.  
  25.  
  26. }
  27.  
  28.  
  29. Uses Graph, Crt;
  30.  
  31.  
  32. {$r-,v-,s-}
  33.  
  34. Procedure MowTheLawn;
  35. Var Sprite: array[1..16] of string [16];
  36.     SpriteLine: string[16];
  37.     Pixel: byte;
  38.  
  39.     PathToDriver: string[80];
  40.     GraphicsDriver: integer;
  41.     GraphicsMode: integer;
  42.     X,Y: byte;
  43.  
  44.     SpriteMemNeeded: word;
  45.     SpritePointer: pointer;
  46.  
  47.     GrassX: word;
  48.     GrassY: word;
  49.  
  50.     LawnMowerX: integer;
  51.     LawnMowerY: integer;
  52.     RealX: integer;
  53.  
  54. Begin
  55.      sprite[1] :='0000000000111100';
  56.      sprite[2] :='0000000011111100';
  57.      sprite[3] :='0000000000111100';
  58.      sprite[4] :='0000000000111100';
  59.      sprite[5] :='0000000001111100';
  60.      sprite[6] :='0000000011111100';
  61.      sprite[7] :='0000000110111100';
  62.      sprite[8] :='0000001100111100';
  63.      sprite[9] :='0000011000111100';
  64.      sprite[10]:='0000110001100110';
  65.      sprite[11]:='0001110001100110';
  66.      sprite[12]:='0011110011000110';
  67.      sprite[13]:='0011110011000110';
  68.      sprite[14]:='0111110011000110';
  69.      sprite[15]:='0011110111001110';
  70.      sprite[16]:='0000000000000000';
  71.  
  72.      GraphicsDriver:=CGA;
  73.      GraphicsMode:=CGAC0;
  74.  
  75.  
  76.      {
  77.      CHANGE THE PATHTODRIVER VARIABLE
  78.      }
  79.  
  80.  
  81.      If ParamCount <>0 Then
  82.         PathToDriver:=ParamStr(1)
  83.      Else
  84.          PathToDriver:='C:\TP7\BGI';
  85.  
  86.      InitGraph(GraphicsDriver, GraphicsMode,PathToDriver);
  87.  
  88.      If GraphResult = grOk Then
  89.         Begin
  90.         For y:=1 to 15 do
  91.             For x:=1 to 15 do
  92.                 Begin
  93.                 SpriteLine:=sprite[y];
  94.                 Pixel:=Ord(SpriteLine[x])-48;
  95.                 If Pixel = 0 Then
  96.                    PutPixel(x,y,0)
  97.                 else
  98.                     PutPixel(x,y,3);
  99.             End;
  100.  
  101.         SpriteMemNeeded:=ImageSize(1,1,16,16);
  102.         GetMem(SpritePointer,SpriteMemNeeded);
  103.         GetImage(1,1,16,16,SpritePointer^);
  104.  
  105.         {
  106.         O.K. Now clear the screen!
  107.         }
  108.  
  109.         SetGraphMode(CGAC0);
  110.  
  111.         SetColor(2);
  112.         MoveTo(160,0);
  113.         LineTo(120,30);
  114.         LineTo(200,30);
  115.         LineTo(160,0);
  116.  
  117.         MoveTo(120,30);
  118.         LineTo(120,71);
  119.         LineTo(200,71);
  120.         LineTo(200,30);
  121.  
  122.         Rectangle(130,34,150,54);
  123.         Rectangle(190,34,170,54);
  124.  
  125.         {
  126.         Draw the sun
  127.         }
  128.  
  129.         SetColor(3);
  130.         Circle(60,20,15);
  131.  
  132.         {
  133.         And now the grass !
  134.         }
  135.  
  136.         SetColor(1);
  137.         GrassY:=72;
  138.         Repeat
  139.               GrassX:=0;
  140.               Repeat
  141.                     OutTextXY(GrassX,GrassY,'▒');
  142.                     Inc(GrassX,8);
  143.               Until (GrassX >= GetMaxX);
  144.               Inc(GrassY,8);
  145.         Until (GrassY >= 200);
  146.  
  147.  
  148.         {
  149.         Now lets kick ass with the LawnMower Man!
  150.         }
  151.  
  152.         {Position the man}
  153.  
  154.  
  155.         LawnMowerY:=72;
  156.  
  157.         Repeat
  158.               LawnMowerX:=(GetMaxX-15);
  159.               Repeat
  160.                     PutImage(LawnMowerX,LawnMowerY,SpritePointer^,AndPut);
  161.                     PutImage(LawnMowerX,LawnMowerY,SpritePointer^,OrPut);
  162.  
  163.                     Repeat
  164.                           Sound (120);
  165.                           Delay(50);
  166.                           NoSound;
  167.                     Until keypressed;
  168.  
  169.                     Memw[$40:$1a]:=Memw[$40:$1c];
  170.  
  171.                     PutImage(LawnMowerX,LawnMowerY,SpritePointer^,XorPut);
  172.                     Dec(LawnMowerX, 4);
  173.                     RealX:=LawnMowerX+4;
  174.  
  175.               Until (RealX = 0);
  176.               Inc(LawnMowerY,16);
  177.         Until LawnMowerY >= 192;
  178.  
  179.         FreeMem(SpritePointer,SpriteMemNeeded);
  180.         End
  181.      Else
  182.          Begin
  183.          TextMode(CO80);
  184.          Writeln('Cannot use the required BGI file (CGA.BGI) !');
  185.          Writeln;
  186.          Writeln('This can be corrected, however. What you do is');
  187.          Writeln('run this program passing the PATH where CGA.BGI');
  188.          Writeln('resides as a program parameter, for example:');
  189.          Writeln;
  190.          Writeln('MOWLAWN C:\TP7\BGI   <- TP7\BGI dir is DEFAULT!');
  191.          Writeln;
  192.          Writeln('I recommend that you create a batch file that');
  193.          Writeln('automatically passes this parameter..');
  194.          Writeln;
  195.          Halt;
  196.      End;
  197. End;
  198.  
  199.  
  200.  
  201.  
  202.  
  203. Procedure IntroduceMe;
  204. Var DoItAgain: boolean;
  205.     Choice: char;
  206.  
  207. Begin
  208.      TextMode(CO40);
  209.      Repeat
  210.           DoItAgain:=False;
  211.           TextBackground(Green);
  212.           TextColor(White);
  213.           ClrScr;
  214.           Gotoxy(6,1);
  215.           Write('ADVANCED LAWNMOWER SIMULATOR');
  216.           Gotoxy(9,2);
  217.           Write('THE HOT, SEXY SEQUEL !');
  218.           Gotoxy(5,7);
  219.           Write('Programming by: Scott Tunstall');
  220.           Gotoxy(5,11);
  221.           TextColor(Red);
  222.           Write('Please select your lawn mower:');
  223.           GotoXY(5,13);
  224.           Write('1: The Tunstall - ''O'' - Matic');
  225.           GotoXY(5,15);
  226.           Write('2: The Ramsay Virgin Mower 2000');
  227.           GotoxY(5,17);
  228.           Write('3: The Lay - Z Langa Lawn Cutter');
  229.           GotoXY(5,19);
  230.           Write('4: The Bassett Lawn Buster');
  231.  
  232.           GotoXY(2,23);
  233.           TextColor(Blue);
  234.           Write('WARNING! Extended playing of this game');
  235.           GotoXY(2,24);
  236.           Write('can make you irresistible to women !');
  237.  
  238.           memw[$40:$1a]:=memw[$40:$1c];
  239.           Choice:= Readkey;
  240.  
  241.           Randomize;
  242.           If Random(1)=1 Then
  243.              Begin
  244.              ClrScr;
  245.              TextColor(Red);
  246.              GotoXY(4,12);
  247.              Write('I am sorry, but that mower is out');
  248.              GotoXY(4,13);
  249.              Write('of order.');
  250.              Delay(3000);
  251.  
  252.              DoItAgain:=true;
  253.           End;
  254.  
  255.      Until DoItAgain = False;
  256.  
  257.  
  258. End;
  259.  
  260.  
  261.  
  262.  
  263.  
  264. Procedure RudeComment;
  265. var Message: string[40];
  266.     XPos: byte;
  267.  
  268. Begin
  269.      TextMode(CO40);
  270.      TextColor(White);
  271.      textBackground(Blue);
  272.  
  273.      ClrScr;
  274.      Case Random(10) of
  275.      0:  Message:='A job well done, son. Here''s 50p';
  276.      1:  Message:='Son, My gran could cut better !';
  277.      2:  Message:='Does your maw know you''re here ?';
  278.      3:  Message:='Do you drink meths at all ?';
  279.      4:  Message:='Come in and meet my daughter, son!';
  280.      5:  Message:='What kind of grass cutting is that ?';
  281.      6:  Message:='Do you do hair dressing, young man ?';
  282.      7:  Message:='You haven''t even cut half the lawn !';
  283.      8:  Message:='Do you want to see my puppies ?';
  284.      9:  Message:='That was the shittest cut I''ve seen !';
  285.      10: Message:='I bet you drink Carling Black Label !';
  286.      End;
  287.  
  288.      XPos:= (40 - Length(Message)) shr 1;
  289.  
  290.      gotoXY(XPos,12);
  291.      Write(Message);
  292.  
  293.      Delay(3000);
  294. End;
  295.  
  296.  
  297.  
  298.  
  299. Procedure YouShouldntSeeThis; Assembler;
  300. Asm
  301. JMP @SoapyBubble
  302.  
  303. @SoapyBubble:
  304. End;
  305.  
  306.  
  307.  
  308.  
  309.  
  310. Begin
  311.      Randomize;
  312.  
  313.      Repeat
  314.            YouShouldntSeeThis;
  315.            IntroduceMe;
  316.            MowTheLawn;
  317.            RudeComment;
  318.      Until False;
  319. End.
  320.  
  321.